package spt.mc.demo.enums;

import java.util.ArrayList;
import java.util.List;



/**
 * API 电梯类型
 * @author cb
 *
 */
public enum APILiftTypeEnum implements Enumerator{
	
	/** 0=其它类型电梯 */
	OTHER(0,"其它类型电梯"),
	/** 1=曳引与强制驱动电梯 */
	TRACTION(1,"曳引与强制驱动电梯"),
	/** 2=液压乘客电梯 */
	HYDRAULIC(2,"液压乘客电梯"),
	/** 3=杂物电梯 */
	SUNDRY(3,"杂物电梯"),
	/** 4=自动扶梯与自动人行道 */
	ESCALATORANDTRAVELATOR(4,"自动扶梯与自动人行道"),
	/** 5=自动扶梯 */
	ESCALATOR(5,"自动扶梯"),
	/** 6=自动人行道 */
	TRAVELATOR(6,"自动人行道"),
	/** 7=防爆电梯 */
	EXPLOSIONPROOF(7,"防爆电梯"),
	/** 8=消防员电梯 */
	FIREMAN(8,"消防员电梯"),
	/** 9=液压驱动电梯 */
	HYDRAULICDRIVE(9, "液压驱动电梯"),
	/** 10=液压载货电梯 */
	HYDRAULICCARGO(10,"液压载货电梯"),
	/** 11=强制驱动载货电梯 */
	FORCEDDRIVECARGO(11,"强制驱动载货电梯"),
	/** 12=曳引驱动乘客电梯 */
	TRACTIONDRIVE(12,"曳引驱动乘客电梯"),
	/** 13=曳引驱动载货电梯 */
	TRACTIONCARGO(13,"曳引驱动载货电梯");

	/** 枚举值 */
	private final int code;
	
	/** 枚举描述 */
	private final String message;
	
	
	private APILiftTypeEnum(int code, String message) {
		this.code = code;
		this.message = message;
	}
	
	/**
	 * @return Returns the code.
	 */
	@Override
	public int code() {
		return code;
	}
	
	/**
	 * @return Returns the message.
	 */
	@Override
	public String message() {
		return message;
	}
	
	/**
	 * 通过枚举<code>code</code>获得枚举
	 * 
	 * @param code
	 * @return EstateResultEnum
	 */
	public static APILiftTypeEnum getByCode(int code) {
		for (APILiftTypeEnum _enum : values()) {
			if (_enum.code()==code) {
				return _enum;
			}
		}
		return null;
	}
	
	/**
	 * 获取全部枚举
	 * 
	 * @return List<EstateResultEnum>
	 */
	public static List<APILiftTypeEnum> getAllEnum() {
		List<APILiftTypeEnum> list = new ArrayList<>();
		for (APILiftTypeEnum _enum : values()) {
			list.add(_enum);
		}
		return list;
	}
	
	/**
	 * 获取全部枚举值
	 * 
	 * @return List<String>
	 */
	public static List<Integer> getAllEnumCode() {
		List<Integer> list = new ArrayList<>();
		for (APILiftTypeEnum _enum : values()) {
			list.add(_enum.code());
		}
		return list;
	}
}
